<?php
require_once('ri/validator/StringLengthValidator.php');

$v= new StringLengthValidator();
$v->setMin(2)
	->setMax(5)
	->setErrorMessage('"%s" is not between 2 and 5 characters long');
try {
	$v->validate('This text is too long');
}
catch (ValidatorException $e) {
	echo($e); // output: "This text is too long" is not between 2 and 5 characters long
}
?>